package com.guoxin.chapter3.waitnotify.pipereaderwriter;

import java.io.IOException;
import java.io.PipedWriter;

public class WriteData {
	public void writeMethod(PipedWriter writer){
		try {
			System.out.println("write:");
			for(int i=0;i<300;i++){
				String outData = ""+(i+1);
				writer.write(outData);
				System.out.print(outData);
			}
			System.out.println();
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
